bin=server
cc=g++
LD_FLAGS=-std=c++11 -lpthread
src=main.cc 
curr=$(shell dzp) 
cgi=test_cgi

ALL:$(bin) $(cgi)
.PHONY:ALL 

$(cgi):cgi/test_cgi.cc
		$(cc) -o $@ $^ -std=c++11 

$(bin):$(src)
		$(cc) -o $@ $^ $(LD_FLAGS)

.PHONY:clean
clean:
		rm -rf $(bin) $(cgi)
		rm -rf output 

.PHONY:output
output:
		mkdir -p output 
		cp $(bin) output 
		cp -rf webroot output 
		cp $(cgi) output/webroot
		cp ./cgi/shell_cgi.sh output/webroot
		cp cgi/mysql_cgi output/webroot

